import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '../views/Login.vue'
import Index from '../views/index.vue'
import Mainhome from '../views/mainhome.vue'
import add from '../views/add.vue'
import videoManagement from '../views/videoManagement.vue'
import videoList from '../views/videoList.vue'
import photoManagement from '../views/photoManagement.vue'
import addPhoto from '../views/addPhoto.vue'
import addVideo from '../views/addVideo.vue'
import addVideoLc from '../views/addVideoLc.vue'
import photoList from '../views/photoList.vue'
import aerialManagement from '../views/aerialManagement.vue'
import personManagement from '../views/personManagement.vue'
import setPoint from '../views/setPoint.vue'
import accessStatistics from "../views/accessStatistics.vue"




Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/login'   //redirect路由重定向
  },
  {
    path: '/Login',
    component: Login
  },
  {
    path: '/index',
    component: Index,
    redirect: '/videoList',
    children: [
    {
      path: '/mainhome',
      component: Mainhome,
      name:'mainhome'
    },
    {
      path: '/add',
      component: add,
      name:'add'
    },
    {
      path: '/videoManagement',
      component: videoManagement,
      name:'videoManagement'
    },
    {
      path: '/videoList',
      component: videoList,
      name:'videoList'
    },
    {
      path: '/photoManagement',
      component: photoManagement,
      name:'photoManagement'
    },
    {
      path: '/addPhoto',
      component: addPhoto,
      name:'addPhoto'
    },
    {
      path: '/addVideo',
      component: addVideo,
      name:'addVideo'
    },
    //addVideoLc
    {
      path: '/addVideoLc',
      component: addVideoLc,
      name:'addVideoLc'
    },
    {
      path: '/photoList',
      component: photoList,
      name:'photoList'
    },
    {
      path: '/aerialManagement',
      component: aerialManagement,
      name:'aerialManagement'
    },
    {
      path: '/personManagement',
      component: personManagement,
      name:'personManagement'
    },
    {
      path: '/setPoint',
      component: setPoint,
      name:'setPoint'
    },
    {
      path:"/accessStatistics",
      component: accessStatistics,
      name:'accessStatistics'
    }
    ]
  },
]

const router = new VueRouter({
  routes
})

// router.beforeEach((to, from, next) => {
//   console.log(to)
//   console.log(from)
// });

export default router
